<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>


  <div id="app">
    <!-- 
      input -> value属性
      textarea -> value
      input:checkbox -> checked状态
      input:radio -> checked状态
      select -> value
    -->

    姓名 :<input type="text" v-model="username">
    <br>
    <br>
    性别: 
    <br> 
    男<input type="radio" v-model="gender" name="gender" value="1">
    女<input type="radio" v-model="gender" name="gender" value="2">
    <br>
    <br>
    爱好: 
    <input type="checkbox" v-model="hobby" value="smoke">
    <input type="checkbox" v-model="hobby2">
    <input type="checkbox" v-model="hobby3">
    <br>
    <br>
    城市:
    <select v-model="cityId">
      <option value="1">北京</option>
      <option value="2">深圳</option>
      <option value="3">哈尔滨</option>
    </select>

    <br>
    <br>
    自我介绍:
    <textarea v-model="desc"></textarea>

    <br>
    <br>
    <button @click="fn">提交</button>

  </div>

  <script src="./js/vue2.6.12.js"></script>

  <script>

    var app = new Vue({
      el:'#app',
      data:{
        username:'',
        gender:'',
        hobby:'',
        hobby2:'',
        hobby3:'',
        cityId:'2',
        desc:'hi'
      },
      methods:{
        fn(){
          console.log(this.username, this.gender, this.hobby,this.hobby2,this.hobby3, this.cityId, this.desc);
        }
      }
    })

    

  </script>
</body>
</html>